<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Position Test</title>
  <style>
    html,
    body {
      margin: 0;
      padding: 0;
      width: 100%;
      height: 100%;
      box-sizing: border-box;
    }

    .wapper {
      position: relative;
      width: 100%;
      height: 100%;
    }

    .posC {
      /** one way
       * position: relative;
       * top: 50%;
       * left: 50%;
       * transform: translate(-50%, -50%); 
       */

      /* another way */
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      margin: auto;
      /* END */

      width: 100px;
      height: 100px;
      background-color: #bfa;
    }
  </style>
</head>

<body>
  <div class="wapper">
    <div class="posC"></div>
  </div>
</body>

</html>